raar.external
Class RAExternalSensor

java.lang.Object
  extended by raar.agent.process.RAProcess
      extended by raar.agent.process.sensor.RASensor
          extended by raar.external.RAExternalSensor
All Implemented Interfaces:
java.io.Serializable, RAAgentDependentProcess, RASensorAllowedInExternal

public class RAExternalSensor
extends RASensor
implements RASensorAllowedInExternal

An external sensor bases its data on data transmitted from an external agent such as a robot class interface. It also contains a simulator sensor that can be used in the simulator.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class raar.agent.process.sensor.RASensor
agent, output, outputName
 
Fields inherited from class raar.agent.process.RAProcess
hasRun, inregister, outregister, register, sourceCode, statement
 
Fields inherited from interface raar.agent.process.RAAgentDependentProcess
NO_AGENT_DEFINED
 
Constructor Summary
RAExternalSensor(RASensor childSimSensor, java.lang.String sensor_id)
          Construct the external sensor with a child sensor that can be used in the simulator environment.
 
Method Summary
 java.lang.String explain()
          Give a String that explains what the sensor does.
 RASensor getChildSimSensor()
          Get child sensor usable in simulator.
 java.lang.String getProcessName()
          Get a process name representation.
 java.lang.String getSensorID()
          Get ID.
 void run()
          Run method queries the agent for value.
 void setAgent(RAAgent a)
          Set agent.
 java.lang.String toString()
          To String.
 
Methods inherited from class raar.agent.process.sensor.RASensor
acceptsInput, dumpRegisters, execute, get, getAgent, getColor, getDataType, getInputNames, getInputObjects, getOutputNames, getOutputObjects, getSensorValue, isSpecial, removeReferenceToAgent, set, setOutput, setReferenceToAgent, setSourceCode, suppliesOutput
 
Methods inherited from class raar.agent.process.RAProcess
clone, getSourceCode, reset, setProcessName
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RAExternalSensor

public RAExternalSensor(RASensor childSimSensor,
                        java.lang.String sensor_id)
Construct the external sensor with a child sensor that can be used in the simulator environment. You must specify a child sensor, otherwise the ex- ternal sensor will not work. Also specify the sensor's id.

Method Detail

getChildSimSensor

public RASensor getChildSimSensor()
Get child sensor usable in simulator.


getSensorID

public java.lang.String getSensorID()
Get ID.


run

public void run()
         throws RAException
Run method queries the agent for value. The agent sends physical or simulated value.

Specified by:
run in class RASensor
Throws:
RAException

setAgent

public void setAgent(RAAgent a)
Set agent.

Overrides:
setAgent in class RASensor

toString

public java.lang.String toString()
To String.

Specified by:
toString in class RASensor

getProcessName

public java.lang.String getProcessName()
Get a process name representation.

Overrides:
getProcessName in class RAProcess

explain

public java.lang.String explain()
Give a String that explains what the sensor does.

Specified by:
explain in class RASensor